home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
090
/
cmln1286.arc
/
BNCHMARK.ADA
/
ACKERMAN.ADA
< prev
next >
Wrap
Text File
|
1986-10-21
|
828b
|
40 lines
--with TEXT_IO; use TEXT_IO;
procedure ACKERMAN is
--
-- Ackerman benchmark
-- Source available from Mark Petersen's Alpo-Net FIDO board at
-- (619) 741-3412, 300/1200/2400 8,N,1
--
------------------------------
-- declarations
------------------------------
x : integer;
------------------------------
-- ACK
------------------------------
function ACK(m : in integer; n : in integer ) return integer is
begin
if m = 0 then
return n + 1;
elsif n = 0 then
return ack(m-1, 1);
else
return ack(m-1, ack(m, n-1));
end if;
end;
begin
for i in 1..10 loop
x := ack(3, 6);
-- put_line("x =" & integer'image(x));
end loop;
end ACKERMAN;